package com.dlc.shop.systemtest.test.store;

import com.dlc.shop.bean.model.OfflineHandleEvent;
import com.dlc.shop.systemtest.api.amount.ProductApi;
import com.dlc.shop.systemtest.data.amount.OfflineHandleEventData;

/**
 * @author lpj
 */
public class ProductAudit {
    private static final Integer STATUS_AUDIT = 6;

    public static void audit(Long productId) {
        if (ProductApi.getProductInfo(productId).getStatus().equals(STATUS_AUDIT)) {
            OfflineHandleEvent offlineHandleEvent = OfflineHandleEventData.getOfflineHandleEvent(null, productId, null);
            offlineHandleEvent.setStatus(3);
            ProductApi.audit(offlineHandleEvent);
        }
    }
}
